﻿using System.Linq;
using _5E.Utils.WebHelper;
using Pool.Business.BLL;
using Pool.WebSite.Service.Models;

namespace Pool.WebSite.Service.Adapter
{
    class LocationAdapter
    {
        private LocationBLL m_bll = new LocationBLL();

        [Ajax]
        public string Search(string q)
        {
            var locations = m_bll.SearchByKeyword(q).Select(l => new Location(l));
            return AjaxHelper.ToCombobox<Location>(locations);
        }

    }
}